﻿using System.Web;
using System.ComponentModel.Composition;
using Core.Interfaces;

namespace Core.Components
{
    [Export(typeof(IRedirector))]
    public class Redirector : IRedirector
    {
        public void GoToProfilesProfile()
        {
            Redirect("~/Profiles/Profile.aspx");
        }

        public void GoToLoginPage()
        {
            Redirect("~/Accounts/Login.aspx");
        }

        public void GoToRegisterSuccessPage()
        {
            Redirect("~/Accounts/RegisterSuccess.aspx");
        }

        public void GoToForgetPassSuccessPage()
        {
            Redirect("~/Accounts/ForgetPasswordSuccess.aspx");
        }

        public void GoToPage(string page)
        {
            Redirect(page);
        }

        private void Redirect(string path)
        {
            HttpContext.Current.Response.Redirect(path);
        }        
    }
}
